<template>
  <div class="x-bar">
    <div
      :id="id"
      :option="option"
      :time="time"
    />
  </div>
</template>

<script>
import HighCharts from 'highcharts'
export default {
  name: 'BaseHightCharts',
  // 验证类型
  props: {
    id: {
      type: String
    },
    option: {
      type: Object
    },
    time: ""
  },
  mounted() {
    var chart = HighCharts.chart(this.id, this.option)
    chart.credits.update({
      enabled: false
    })
  },
  watch: {
    time() {
      var chart = HighCharts.chart(this.id, this.option);
      chart.credits.update({
        enabled: false
      })
      deep:true
    }
  }

}
</script>

<style scoped>
  .x-bar{
    height: 100%;
    width: 100%;
  }


</style>
